Class HCC.Interface.WS.spec Extends %REST.Spec [ ProcedureBlock ]
{

XData OpenAPI [ MimeType = application/json ]
{
{
  "swagger":"2.0",
  "info":{
    "title":"WS API",
    "version":"3.0"
  },
  "security":[
    {
      "basicAuth":[
      ]
    }
  ],
  "securityDefinitions":{
    "basicAuth":{
      "type":"basic"
    }
  },
  "basePath":"/hcc/ws",
  "schemes":[
    "https",
    "http"
  ],
  "paths":{
    "/DocumentHTML/{Id}":{
      "get":{
        "description":"获取html格式的共享文档",
        "tags":[
          "文档"
        ],
        "operationId":"GetDocumentHTML",
        "produces":[
          "text/html"
        ],
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"文档Id",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"成功获取html格式的共享文档",
            "schema":{
              "$ref":"#/definitions/DocumentHTML"
            }
          }
        }
      }
    },
    "/Document/{Id}":{
      "get":{
        "tags":[
          "文档"
        ],
        "description":"获取指定id的共享文档",
        "operationId":"GetDocument",
        "produces":[
          "application/xml"
        ],
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"文档Id",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"",
            "schema":{
              "$ref":"#/definitions/Document"
            }
          }
        }
      },
      "delete":{
        "tags":[
          "文档"
        ],
        "operationId":"DeleteDoc",
        "description":"删除指定id的共享文档",
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"文档Id",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"共享文档删除成功"
          }
        }
      }
    },
    "/GenDocument/{Id}":{
      "get":{
        "tags":[
          "文档"
        ],
        "operationId":"GenerateDocFromSQL",
        "description":"生成目标id的共享文档",
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"文档Id",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"生成共享文档成功"
          }
        }
      }
    },
    "/DE":{
      "get":{
        "tags":[
          "数据元"
        ],
        "description":"获取数据元",
        "operationId":"ListDE",
        "parameters":[
        ],
        "responses":{
          "200":{
            "description":"成功获取数据元",
            "schema":{
              "$ref":"#/definitions/DE"
            }
          }
        }
      },
      "put":{
        "tags":[
          "数据元"
        ],
        "operationId":"PutDE",
        "description":"更新/新增数据元",
        "parameters":[
          {
            "name":"body",
            "in":"body",
            "description":"数据元",
            "required":true,
            "schema":{
              "$ref":"#/definitions/PutDE"
            }
          }
        ],
        "responses":{
          "200":{
            "description":"更新数据元成功"
          }
        }
      }
    },
    "/DE/{Id}":{
      "get":{
        "tags":[
          "数据元"
        ],
        "operationId":"GetDE",
        "description":"获取指定id数据元",
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"数据元Id",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"成功获取数据元",
            "schema":{
              "$ref":"#/definitions/DE"
            }
          }
        }
      }
    },
    "/VS":{
      "get":{
        "tags":[
          "值集"
        ],
        "description":"获取全部值集信息",
        "operationId":"ListValueSet",
        "parameters":[
        ],
        "responses":{
          "200":{
            "description":"OK",
            "schema":{
              "$ref":"#/definitions/VS"
            }
          }
        }
      }
    },
    "/VS/{Id}":{
      "get":{
        "tags":[
          "值集"
        ],
        "description":"获取特定值集",
        "operationId":"ListValueSetItems",
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"值集Id",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"获取特定值集成功",
            "schema":{
              "$ref":"#/definitions/VSList"
            }
          }
        }
      },
      "delete":{
        "tags":[
          "值集"
        ],
        "operationId":"DeleteValueSet",
        "description":"删除特定值集",
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"值集Id",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"删除特定值集成功"
          }
        }
      },
      "put":{
        "tags":[
          "值集"
        ],
        "description":"更新/新增特定值集",
        "operationId":"PutValueSetItem",
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"值集Id",
            "required":true,
            "type":"string"
          },
          {
            "name":"body",
            "in":"body",
            "description":"值集",
            "required":true,
            "schema":{
              "$ref":"#/definitions/VS"
            }
          }
        ],
        "responses":{
          "200":{
            "description":"更新特定值集成功"
          }
        }
      }
    },
    "/VS/{Id}/{key}":{
      "get":{
        "tags":[
          "值集"
        ],
        "description":"获取指定值集指定key的值",
        "operationId":"GetValueSetItem",
        "produces":[
          "text/plain"
        ],
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"值集Id",
            "required":true,
            "type":"string"
          },
          {
            "name":"key",
            "in":"path",
            "description":"值集key",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"获取特定值集值成功",
            "schema":{
              "$ref":"#/definitions/VSValue"
            }
          }
        }
      },
      "delete":{
        "tags":[
          "值集"
        ],
        "operationId":"DeleteValueSetItem",
        "description":"删除指定id的值集",
        "parameters":[
          {
            "name":"Id",
            "in":"path",
            "description":"值集Id",
            "required":true,
            "type":"string"
          },
          {
            "name":"key",
            "in":"path",
            "description":"值集key",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"删除特定值集值成功"
          }
        }
      }
    },
    "/DocSection/{Doctype}":{
      "get":{
        "tags":[
          "共享文档章节"
        ],
        "description":"获取共享文档章节设置",
        "operationId":"GetDocSections",
        "parameters":[
          {
            "name":"Doctype",
            "in":"path",
            "description":"文档类型",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"获取文档章节设置成功",
            "schema":{
              "$ref":"#/definitions/DocSection"
            }
          }
        }
      },
      "put":{
        "tags":[
          "共享文档章节"
        ],
        "operationId":"UpdateDocSections",
        "description":"更新共享文档章节设置",
        "parameters":[
          {
            "name":"Doctype",
            "in":"path",
            "description":"文档类型",
            "required":true,
            "type":"string"
          },
          {
            "name":"body",
            "in":"body",
            "description":"文档章节设置",
            "required":true,
            "schema":{
              "$ref":"#/definitions/DocSection"
            }
          }
        ],
        "responses":{
          "200":{
            "description":"更新文档章节设置成功"
          }
        }
      }
    },
    "/Log":{
      "get":{
        "tags":[
          "共享文档日志"
        ],
        "description":"获取共享文档生成日志",
        "operationId":"GetHCCLog",
        "parameters":[
        ],
        "responses":{
          "200":{
            "description":"获取共享文档生成日志成功",
            "schema":{
              "$ref":"#/definitions/Log"
            }
          }
        }
      }
    },
    "/PatDocs/{PatNo}":{
      "get":{
        "tags":[
          "患者"
        ],
        "description":"获取病人所有的共享文档编号信息",
        "operationId":"GetPatientDocList",
        "parameters":[
          {
            "name":"PatNo",
            "in":"path",
            "description":"病人号",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"获取病人文档成功",
            "schema":{
              "$ref":"#/definitions/PatDocs"
            }
          }
        }
      }
    },
    "/PatCount":{
      "get":{
        "tags":[
          "患者"
        ],
        "operationId":"GetPatientCount",
        "description":"获取病人数量计数",
        "parameters":[
        ],
        "responses":{
          "200":{
            "description":"获取病人计数成功",
            "examples":{
              "application/json":{
                "Count":34
              }
            }
          }
        }
      }
    },
    "/CheckSQLData":{
      "get":{
        "tags":[
          "SQL数据质量检查"
        ],
        "description":"sql 模型约束检查",
        "operationId":"CheckSQLData",
        "parameters":[
          {
            "name":"Table",
            "in":"query",
            "description":"表名",
            "required":true,
            "type":"string"
          },
          {
            "name":"Batch",
            "in":"query",
            "description":"批次号",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"获取数据质量检查结果成功",
            "examples":{
              "application/json":{
                "msg":"表:HCC_SQL_Document_Header.Authenticator,批次:1 数据质量检查已在后台执行,请随后检查日志HIP_DataGov.Log"
              }
            }
          }
        }
      }
    },
    "/Patient":{
      "get":{
        "tags":[
          "患者"
        ],
        "description":"查询患者",
        "operationId":"SearchPatient",
        "parameters":[
          {
            "name":"IDNo",
            "in":"query",
            "description":"患者身份证号",
            "required":false,
            "type":"string"
          },
          {
            "name":"Name",
            "in":"query",
            "description":"患者姓名",
            "required":false,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"查询患者",
            "schema":{
              "$ref":"#/definitions/Patient"
            }
          }
        }
      }
    },
    "/CheckDoc/{DocPath}":{
      "get":{
        "tags":[
          "共享文档校验"
        ],
        "operationId":"CheckDoc",
        "description":"共享文档校验",
        "parameters":[
          {
            "name":"DocPath",
            "in":"path",
            "description":"文档路径",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"获取共享文档检查结果成功",
            "schema":{
              "$ref":"#/definitions/CheckDoc"
            }
          }
        }
      }
    },
    "/DocValid":{
      "post":{
        "description":"",
        "tags":[
          "共享文档校验"
        ],
        "operationId":"DocValid",
        "consumes":[
          "application/xml"
        ],
        "parameters":[
          {
            "name":"body",
            "in":"body",
            "description":"文档路径",
            "required":true,
            "schema":{
              "$ref":"#/definitions/DocValid"
            }
          }
        ],
        "responses":{
          "200":{
            "description":"OK",
            "schema":{
              "$ref":"#/definitions/CheckDoc"
            }
          }
        }
      }
    }
  },
  "definitions":{
    "DocumentHTML":{
      "format":"html",
      "type":"object",
      "description":"html格式的共享文档",
      "example":"<html><body><h1>hello world</h1></body></html>"
    },
    "Document":{
      "format":"xml",
      "type":"object",
      "description":"xml格式的共享文档",
      "example":"<xml>a</xml>"
    },
    "PutDE":{
      "type":"object",
      "properties":{
        "name":{
          "type":"string",
          "example":"WS.DE.DE010000200"
        },
        "category":{
          "type":"string",
          "example":"标识"
        },
        "description":{
          "type":"string",
          "example":"报告卡编码"
        },
        "format":{
          "type":"string",
          "example":"N1"
        },
        "valueset":{
          "type":"string",
          "example":"DE01.00.002.00"
        },
        "datatype":{
          "type":"string",
          "example":"S2"
        }
      }
    },
    "DE":{
      "type":"array",
      "items":{
        "type":"object",
        "properties":{
          "name":{
            "type":"string",
            "example":"WS.DE.DE010000200"
          },
          "category":{
            "type":"string",
            "example":"标识"
          },
          "description":{
            "type":"string",
            "example":"报告卡编码"
          },
          "format":{
            "type":"string",
            "example":"N1"
          },
          "valueset":{
            "type":"string",
            "example":"DE01.00.002.00"
          },
          "datatype":{
            "type":"string",
            "example":"S2"
          }
        }
      }
    },
    "VS":{
      "type":"array",
      "items":{
        "type":"object",
        "properties":{
          "name":{
            "type":"string",
            "example":"CV02.011.01"
          }
        }
      }
    },
    "VSList":{
      "type":"array",
      "items":{
        "type":"object",
        "properties":{
          "key":{
            "type":"string",
            "example":"99"
          },
          "value":{
            "type":"string",
            "example":"其他法定有效证件"
          }
        }
      }
    },
    "VSValue":{
      "type":"string",
      "example":"其他法定有效证件"
    },
    "DocSection":{
      "type":"array",
      "items":{
        "type":"object",
        "properties":{
          "DocumentSection":{
            "type":"string",
            "example":"99"
          },
          "Cardinality":{
            "type":"string",
            "example":"1..1"
          }
        }
      }
    },
    "Log":{
      "type":"array",
      "items":{
        "type":"object",
        "properties":{
          "Action":{
            "type":"string",
            "example":"GenDoc"
          },
          "DocNum":{
            "type":"string",
            "example":"Doc1"
          },
          "LogTime":{
            "type":"string",
            "example":"2022-01-04 13:05:10.8923"
          },
          "Msg":{
            "type":"string",
            "example":"文档生成开始"
          },
          "Type":{
            "type":"string",
            "example":"Info"
          }
        }
      }
    },
    "PatDocs":{
      "type":"array",
      "items":{
        "type":"object",
        "properties":{
          "DocId":{
            "type":"string",
            "example":"Doc20230405"
          },
          "DocName":{
            "type":"string",
            "example":"住院病案首页"
          },
          "AddDate":{
            "type":"string",
            "example":"2023-04-05 16:42:48.9164"
          }
        }
      }
    },
    "Patient":{
      "type":"array",
      "items":{
        "type":"object",
        "properties":{
          "IDNo":{
            "type":"string",
            "example":"130109197706015516"
          },
          "Name":{
            "type":"string",
            "example":"刘二好"
          }
        }
      }
    },
    "CheckDoc":{
      "type":"object",
      "properties":{
        "Msg":{
          "type":"array",
          "items":{
            "type":"object",
            "properties":{
              "ErrType":{
                "type":"string",
                "example":"条目缺失"
              },
              "ErrPath":{
                "type":"string",
                "example":"ClinicalDocument|component|structuredBody|component|11450-4|section|entry|DE05.01.072.00"
              },
              "ErrMsg":{
                "type":"string",
                "example":"缺失:ClinicalDocument|component|structuredBody|component|11450-4|section|entry|DE05.01.072.00"
              }
            }
          }
        }
      }
    },
    "DocValid":{
      "type":"string"
    }
  }
}
}

}
